package org.example.teaView;

import javax.swing.*;

public class Firstview extends JFrame implements Runnable{
    public JButton seeTotal;
    public JButton addTopic;
    public JButton deleteTopic;
    public JButton changeTopic;
    public JButton seeStu;
    HandleFirst handleFirst;
    public Firstview(){
        init();
        fistListener();
    }
    public void init(){
        this.setSize(512,612);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
        this.setAlwaysOnTop(true);
        this.setLayout(null);
        this.setVisible(true);
        this.setTitle("教师管理页面-3220608045吉治霖软件2202");

        // 查看题库按钮 设置
        seeTotal = new JButton("查看所有题目");
        seeTotal.setBounds(130,75,250,50);
        this.getContentPane().add(seeTotal);
        // 添加题库按钮 设置
        addTopic = new JButton("添加题目");
        addTopic.setBounds(130,175,250,50);
        this.getContentPane().add(addTopic);
        // 删除题库按钮 设置
        deleteTopic = new JButton("删除题目");
        deleteTopic.setBounds(130,275,250,50);
        this.getContentPane().add(deleteTopic);
        // 修改题库按钮 设置
        changeTopic = new JButton("修改题目");
        changeTopic.setBounds(130,375,250,50);
        this.getContentPane().add(changeTopic);
        // 查看学生成绩按钮 设置
        seeStu = new JButton("查看学生成绩");
        seeStu.setBounds(130,475,250,50);
        this.getContentPane().add(seeStu);
    }

    private void fistListener() {
        handleFirst = new HandleFirst();// HandleAddWord
        handleFirst.setFirstview(this);// HandleAddWord
        seeTotal.addActionListener(handleFirst);
        addTopic.addActionListener(handleFirst);
        deleteTopic.addActionListener(handleFirst);
        changeTopic.addActionListener(handleFirst);
        seeStu.addActionListener(handleFirst);
    }

    @Override
    public void run() {}
}
